/**
 * StringUtils
 * 
 * 09/10/2023
 * 
 * Copyright GPL
 */
package info.victor.utils;

/**
 * This class is for utilities of strings
 */
public class StringUtils {

	/**
	 * this function checks if the parameter is a number or not
	 * @param strNumber
	 * @return
	 */
	public static boolean isNumber(String strNumber){
		boolean canConvertToInteger = false;
		
		try {
			Integer.parseInt(strNumber);
			canConvertToInteger = true;
		} catch (Exception e) {
			canConvertToInteger = false;
			e.printStackTrace();
		}
		
		return canConvertToInteger;
	}
	
	/**
	 * this checks if the strings are void or null
	 * @param title
	 * @param tale
	 * @return
	 */
	public static boolean checkVoidStrings(String title, String tale){
		return (title != null && !title.replaceAll(" ", "").equals("")) &&
				(tale != null && !tale.replaceAll(" ", "").equals(""));
	}
}
